<div id="pad-wrapper" class="new-user">
	<div class="row-fluid header">
		<h3>产品添加</h3>
	</div>
	<div class="row-fluid form-wrapper">
		<!-- left column -->
		<div class="span9 with-sidebar">
			<div class="container">
				<form class="new_user_form form-horizontal" action="/product/save" method="post" id="dataForm" enctype="multipart/form-data">
		                <input type="hidden" name="cate_id" value="<?php echo $cate_id?>" />
				<div class="field-box"></div>
				<div class="control-group form-group span12">
				  <label class="control-label" for="organization_name">产品名称：</label>
				  <div class="controls col-lg-5">
					<input type="text" id="product_name" name="product_name" data-bv-notempty="" data-bv-notempty-message="产品不能为空" />
					</div>
				</div>
                                <div class="control-group form-group span12">
					<label class="control-label" for="organization_name">产品副标题：</label>
					<div class="controls col-lg-5">
					    <textarea id="short_description" style="height:50px;width:700px;font-size:12px;" name="short_description" placeholder="产品副标题" data-bv-notempty="" data-bv-notempty-message="产品副标题不能为空"></textarea>
					</div>
				</div>
				<div class="control-group form-group span12">
				  <label class="control-label" for="market_price">产品市场价格：</label>
				  <div class="controls col-lg-5">
				  	<input type="text" id="market_price" name="market_price" data-bv-notempty="" data-bv-notempty-message="产品市场价格不能为空" />
				  </div>
				</div>
				<div class="control-group form-group span12">
				  <label class="control-label" for="product_price">产品价格：</label>
				  <div class="controls col-lg-5">
				  	<input type="text" id="product_price" name="product_price"  data-bv-notempty="" data-bv-notempty-message="产品价格不能为空" />
				  </div>
				</div>
                                <?php if($cate_id == 1):?>
                                <div class="control-group form-group span12">
				  <label class="control-label" for="bind_check_length">套件码位数：</label>
				  <div class="controls col-lg-5">
					<input type="text" id="bind_check_length" name="bind_check_length" />
					</div>
				</div>
                                
				<div class="control-group form-group span12">
				  <label class="control-label" for="description">产品描述：</label>
				  <div class="controls col-lg-5">
				  	<script type="text/plain" id="myEditor" style="width:1000px;height:240px;" name="description">
		
					</script>                                      
                                                                 
				  </div>
                                  <?php endif;?>
                                  <?php if($cate_id == 3):?>
                                  <div class="control-group form-group span12">
                                  <?php endif;?>
                                    <label class="control-label" for="home_html">主页面：</label>  
                                    <div class="controls col-lg-5">
				  	<script type="text/plain" id="home_html" style="width:1000px;height:240px;" name="home_html">
					
					</script>
				    </div>
                                    
                                    <label class="control-label" for="icon">产品缩略图：</label>
					<div class="controls col-lg-5">
						<script type="text/plain" id="product_img" style="width:1000px;height:240px;" name="product_img">
					</script>
			         </div>
                                    
                                  <?php if($cate_id == 1):?>				                                                
				  <label class="control-label" for="bind_img">绑定图片：</label>
				  <div class="controls col-lg-5">
				  	<script type="text/plain" id="bind_img" style="width:1000px;height:240px;" name="bind_img">
					
					</script>
				  </div>
                                 
				  <label class="control-label" for="bind_html">绑定页面：</label>
				  <div class="controls col-lg-5">
				  	<script type="text/plain" id="bind_html" style="width:1000px;height:240px;" name="bind_html">
					
					</script>
				  </div>
                                  
                           
				  <label class="control-label" for="item_success_html">样品绑定成功：</label>
                                  <div class="controls col-lg-5">
				  	<script type="text/plain" id="item_success_html" style="width:1000px;height:240px;" name="item_success_html">
					
					</script>
				  </div>
                                 <?php endif;?>
				  <label class="control-label" for="pay_success_html">支付成功：</label>
				  <div class="controls col-lg-5">
				  	<script type="text/plain" id="pay_success_html" style="width:1000px;height:240px;" name="pay_success_html">
					
					</script>
				  </div>
                                  
                                   <label class="control-label" for="code">二维码：</label>
				  <div class="controls col-lg-5">
				  	<script type="text/plain" id="code" style="width:1000px;height:240px;" name="code">
					
					</script>
				  </div>
				</div>
				<div class="span12 field-box"></div>
				<div class="control-group form-group span12 actions">
				  <label class="control-label"></label>
				  <div class="controls col-lg-5">
					<input type="submit" class="btn-glow primary" value="提交" />
					&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="reset" class="btn-glow btn" value="取消" />
				  </div>
				</div>
				</form>
			</div>
		</div>
		<!-- side right column -->
		<div class="span3 form-sidebar pull-right">
		</div>
	</div>
	<script type="text/javascript">
	$(document).ready(function() {
		$('#dataForm').bootstrapValidator({
			message: 'This value is not valid',
			feedbackIcons: {
				valid: 'glyphicon glyphicon-ok',
				invalid: 'glyphicon glyphicon-remove',
				validating: 'glyphicon glyphicon-refresh'
			},
			fields: {
				product_name: {
					message: '产品名称不符合规则',
					validators: {
						notEmpty: {
							message: '产品名称是必填项，不能为空'
						},
                                                stringLength:{
                                                        min: 0,
                                                        max: 30,
                                                        message: '产品名称不能超过30个字'
                                                }
					}
				},
				short_description: {
					message: '产品副标题不符合规则',
					validators: {
						notEmpty: {
							message: '产品副标题是必填项，不能为空'
						},
                                                stringLength:{
                                                        min: 0,
                                                        max: 100,
                                                        message: '产品副标题不能超过100个字'
                                                }
					}
				}

				
			}
		});
	});
	</script>
	<script type="text/javascript">
    //实例化编辑器
    var um = UM.getEditor('myEditor',{
    	imagePath: "<?php echo STATIC_IMAGE?>upload/",
    	imageUrl : "/ueditor/upload",
      });
    var um = UM.getEditor('home_html',{
    	imagePath: "<?php echo STATIC_IMAGE?>upload/",
    	imageUrl : "/ueditor/upload",
      });
      var um = UM.getEditor('product_img',{
    	imagePath: "<?php echo STATIC_IMAGE?>upload/",
    	imageUrl : "/ueditor/upload",
      });
       var um = UM.getEditor('bind_img',{
    	imagePath: "<?php echo STATIC_IMAGE?>upload/",
    	imageUrl : "/ueditor/upload",
      });
       var um = UM.getEditor('bind_html',{
    	imagePath: "<?php echo STATIC_IMAGE?>upload/",
    	imageUrl : "/ueditor/upload",
      });
       var um = UM.getEditor('item_success_html',{
    	imagePath: "<?php echo STATIC_IMAGE?>upload/",
    	imageUrl : "/ueditor/upload",
      });
       var um = UM.getEditor('pay_success_html',{
    	imagePath: "<?php echo STATIC_IMAGE?>upload/",
    	imageUrl : "/ueditor/upload",
      });
       var um = UM.getEditor('code',{
    	imagePath: "<?php echo STATIC_IMAGE?>upload/",
    	imageUrl : "/ueditor/upload",
      });

</script>
</div>